package cn.gok.service.Impl;

import cn.gok.mapper.ExcelMapper;
import cn.gok.pojo.Examination;
import cn.gok.pojo.ExcelsPro;
import cn.gok.service.ExcelsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExcelServiceImpl implements ExcelsService {
    @Autowired(required = false)
    private ExcelMapper excelsMapper;
    @Override
    public Integer save(List<ExcelsPro> list) {
        int sum = 0;
        for (ExcelsPro excelsPro : list) {
            System.out.println(excelsPro);
            sum += excelsMapper.addExcels(excelsPro);
        }
        return sum;
    }

    @Override
    public Integer saveData(List<Examination> list) {
        int sum=0;
        for (Examination databases:list){
            System.out.println(databases);
            sum+=excelsMapper.addDatas(databases);
        }
        return sum;
    }

    @Override
    public List<Examination> sel() {
        return excelsMapper.sel();
    }


}
